package com.chat.api.web.vo;

import com.chat.api.utils.util.ParamUtil;
import com.chat.api.web.po.LikeBean;
import com.chat.api.web.po.UserBean;
import lombok.Data;

import javax.persistence.Column;

@Data
public class LikeEntity {
    private String id;
    private String userId;
    private String blogId;
    private String isLike;//是否点赞
    private String isCollect;//是否收藏

    public void setBean(LikeBean bean){
        bean.setId(ParamUtil.getLongParameter(id,-1L));
        bean.setUserId(ParamUtil.getLongParameter(userId,-1L));
        bean.setUserId(ParamUtil.getLongParameter(blogId,-1L));
        bean.setIsLike(Integer.parseInt(isLike));
        bean.setIsCollect(Integer.parseInt(isCollect));
    }

    public void setEntity(LikeBean bean){
        this.setId(String.valueOf(bean.getId()));
        this.setUserId(String.valueOf(bean.getUserId()));
        this.setBlogId(String.valueOf(bean.getBlogId()));
        this.setIsLike(String.valueOf(bean.getIsLike()));
        this.setIsCollect(String.valueOf(bean.getIsCollect()));
    }
}
